
<?php 
/* 
Template Name: process_load_all_user- ajax 
*/
?>
<?php 
if ( ! current_user_can( 'list_users' ) ) 
    {
      wp_die( __( 'bạn không có quyền truy cập trang này! ' ) );

            global $current_user;
            get_currentuserinfo();
    }//if ( ! current_user_can( 'list_users' ) ) 
    else {  
        if (isset($_POST['ID'])) 
                      {
                        $iduser = $_POST['ID'] ;
//$sql = "SELECT * FROM wp_users INNER JOIN  wp_user_wp_may  ON wp_users.ID = wp_user_wp_may.ID WHERE id_may =".$idmay.";";  
       // $sql = "SELECT * FROM wp_user_wp_may";  
/*
SELECT Orders.OrderID, Customers.CustomerName, Orders.OrderDate
FROM Orders
INNER JOIN Customers
ON Orders.CustomerID=Customers.CustomerID;
*/
$sql = "SELECT wp_user_wp_may.ID,wp_user_wp_may.id_may,wp_users.ID,wp_users.user_login
        FROM wp_user_wp_may
        INNER JOIN wp_users
        ON wp_users.ID = wp_user_wp_may.ID
        WHERE wp_user_wp_may.ID = ".$iduser;
//var_dump($sql);

$row = $wpdb->get_results($sql);
                      
//var_dump($row);
$json = json_encode($row);
  echo $json;
                      
                       
                      }//if (isset($_POST['idmay'])) 
 } //elseif ( ! current_user_can( 'list_users' ) )  ?>
    
